#!/usr/env/bin python
# -*- coding: utf-8 -*-

# @Time    : 2020/7/12 10:36|10:36
# @Author  : yangdingyi
# @File    : 2020-07-12.1.5460. 好数对的数目
# @Software: PyCharm
from typing import List


class Solution:
    def numIdenticalPairs(self, nums: List[int]) -> int:
        ans = 0
        if not nums:
            return ans
        ln = len(nums)
        for i in range(ln):
            for j in range(i+1, ln):
                if nums[i] == nums[j]:
                    ans += 1
        return ans


